#Include <ScreenCapture.au3>
#Include <Function For Save As.au3>


AutoItSetOption("MustDeclareVars", 1)   ;Variables must be pre-declared.
Dim Const $sLogFileName =  "Save As3"   ;Log file named(Same with .au3 file name).

Common_WriteCurrentFunctionNameToTempTXT($sLogFileName)
CloseOpenedExcel($oExcel) 
;SaveAs_DocumentSaveAs()
SaveAs_DocumentSaveAs_1()
SaveAs_DocumentSaveAs_2()
SaveAs_DocumentSaveAs_3()
SaveAs_DocumentSaveAs_4()
SaveAs_DocumentSaveAs_5()
SaveAs_DocumentSaveAs_6()
SaveAs_DocumentSaveAs_7()
SaveAs_DocumentSaveAs_8()
SaveAs_DocumentSaveAs_9()

Func SaveAs_DocumentSaveAs_1()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)	
	
	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dwg_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dwg.dwg', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dwg.dwg')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_2()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)	

	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dws_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dws.dws', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dws.dws')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_3()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)	
	
	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dwt_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dwt.dwt', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dwt.dwt')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
EndFunc

Func SaveAs_DocumentSaveAs_4()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dxf_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dxf.dxf', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dxf.dxf')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_5()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "iWorks_key_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'iWorks_key.key', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'iWorks_key.key')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
EndFunc

Func SaveAs_DocumentSaveAs_6()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "iWorks_numbers_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'iWorks_numbers.numbers', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'iWorks_numbers.numbers')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
		
EndFunc
	
Func SaveAs_DocumentSaveAs_7()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "iWorks_pages_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'iWorks_pages.pages', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'iWorks_pages.pages')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_8()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "OneNote_one_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'OneNote_one.one', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'OneNote_one.one')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
EndFunc	

Func SaveAs_DocumentSaveAs_9()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "OneNote_onepkg_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'OneNote_onepkg.onepkg', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'OneNote_onepkg.onepkg')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	Common_Close_PM($hPMHandle) 
EndFunc	


Func SaveAs_DocumentSaveAs()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)	
	
	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dwg_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dwg.dwg', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dwg.dwg')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dws_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dws.dws', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dws.dws')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dwt_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dwt.dwt', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dwt.dwt')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "AutoCAD_dxf_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'AutoCAD_dxf.dxf', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'AutoCAD_dxf.dxf')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "iWorks_key_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'iWorks_key.key', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'iWorks_key.key')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "iWorks_numbers_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'iWorks_numbers.numbers', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'iWorks_numbers.numbers')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "iWorks_pages_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'iWorks_pages.pages', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'iWorks_pages.pages')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "OneNote_one_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'OneNote_one.one', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'OneNote_one.one')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "OneNote_onepkg_To" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'OneNote_onepkg.onepkg', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(12)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(25)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'OneNote_onepkg.onepkg')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	Common_Close_PM($hPMHandle) 
EndFunc
